﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Loggerz.Interfaces.Log;
using Loggerz.Enumerations;
using Loggerz.Interfaces.User;

namespace Loggerz.Classes.LogClass
{
   public  class LogBase : ILoggerBase
    {

        private Exception _errorItem;
        private int _sequenceNumber;
        private Level _level;
        private byte[] _image;
        private DateTime _createdDateTime;
        private string _internalErrorCode;
        private string _userErrorMessage;
        private string _callingClass;
        private string _callingMethod;
        private IUserBase _user;
        private Guid _guid;

        public Exception ErrorItem
        {
            get
            {
                return _errorItem;
            }
            set
            {
                _errorItem = value;
            }
        }

        public int SequenceNumber
        {
            get
            {
                return _sequenceNumber;
            }
            set
            {
                _sequenceNumber = value;
            }
        }

        public Level ErrorLevel
        {
            get
            {
                return _level;
            }
            set
            {
                _level = value;
            }
        }

        public byte[] Image
        {
            get
            {
                return _image;
            }
            set
            {
                _image = value;
            }
        }

        public DateTime CreatedDateTime
        {
            get
            {
                return _createdDateTime;
            }
            set
            {
                _createdDateTime = value;
            }
        }

        public string InternalErrorCode
        {
            get
            {
                return _internalErrorCode;
            }
            set
            {
                _internalErrorCode = value;
            }
        }

        public string UserErrorMessage
        {
            get
            {
                return _userErrorMessage;
            }
            set
            {
                _userErrorMessage = value;
            }
        }

        public string CallingClass
        {
            get
            {
                return _callingClass;
            }
            set
            {
                _callingClass = value;
            }
        }

        public string CallingMethod
        {
            get
            {
                return _callingMethod;
            }
            set
            {
                _callingMethod = value;
            }
        }

        public IUserBase User
        {
            get
            {
                return _user;
            }
            set
            {
                _user = value;
            }
        }

        public Guid UniqueID
        {
            get
            {
                return _guid;
            }
            set
            {
                _guid = value;
            }
        }

        public LogBase(Exception errorMessage, int sequenceNumber, Level level, string callingClass, string callingMethod, IUserBase user, Guid guid,
            string internalErrorCode = "", string userErrorMessage = "",  byte[] image = null)
        {
            _errorItem = errorMessage;
            _sequenceNumber = sequenceNumber;
            _level = level;
            _image = image;
            _createdDateTime = DateTime.Now;
            _internalErrorCode = internalErrorCode;
            _userErrorMessage = userErrorMessage;
            _callingClass = callingClass;
            _callingMethod = callingMethod;
            _user = user;
            _guid = guid;
        }

    }
}
